home *** CD-ROM | disk | FTP | other *** search
- #ifndef xfileTranslator_h
- #define xfileTranslator_h
-
- #include <maya/MPxFileTranslator.h>
-
- class xfileTranslator: public MPxFileTranslator
- {
- public:
-
- xfileTranslator(){}; // constructor
- ~xfileTranslator(){}; // destructor
-
- static void* creator()
- { return new xfileTranslator(); };
- MStatus reader(const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode)
- { return MS::kSuccess; };
- MStatus writer(const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode);
- bool haveReadMethod() const
- { return false; };
- bool haveWriteMethod() const
- { return true; };
- bool canBeOpened() const
- { return false; };
- MString defaultExtension() const
- { return ""; };
- MFileKind identifyFile (const MFileObject& fileName, const char *buffer, short size) const
- { return kIsMyFileType; };
-
- };
-
-
-
- #define WRITE_FLOAT(pbCur, fVal) { \
- float* pf = (float*)pbCur; \
- *(pf++) = fVal; \
- pbCur = (PBYTE)pf; \
- }
-
- #define WRITE_PCHAR(pbCur, pcVal) { \
- char** ppc = (char**)pbCur; \
- *(ppc++) = pcVal; \
- pbCur = (PBYTE)ppc; \
- }
-
- #define WRITE_DWORD(pbCur, dwVal) { \
- DWORD* pdw = (DWORD*)pbCur; \
- *(pdw++) = dwVal; \
- pbCur = (PBYTE)pdw; \
- }
-
- #define WRITE_WORD(pbCur, wVal) { \
- WORD* pw = (WORD*)pbCur; \
- *(pw++) = wVal; \
- pbCur = (PBYTE)pw; \
- }
-
- #define SCENE_ROOT "SCENE_ROOT"
-
- #endif